package ext;

import image.ImageGroup;
import image.ps.PixelShader;
import math.vec2i;
import math.vec3;

public class PSGamma extends PixelShader
{
    
    public double mRecGamma;
    
    public int mTargetI3;
    
    
    public PSGamma()
    {
        super();
        this.mRecGamma = 1.0;
        this.mTargetI3 = -1;
    }
    
    
    public PixelShader copy()
    {
        PSGamma copy = new PSGamma();
        copy.mRecGamma = this.mRecGamma;
        copy.mTargetI3 = this.mTargetI3;
        return copy;
    }
    
    
    public void shade(
            ImageGroup aTarget, 
            vec2i aImagePixel, 
            vec2i aImageSize)
    {
        vec3 datum = aTarget.image3(this.mTargetI3).read(aImagePixel);
        datum.pow(this.mRecGamma);
    }
    
    
}
